wAs an example the description of the
ADT Integer is presented.
Let k be an integer expression:
wADT Integer
is
w Data
w A sequence of
digits optionally prefixed by a plus or minus
sign. We refer to this signed whole number as N.
w Operations
w constructor: Creates a new integer.
w add(k): Creates a new integer which is the sum of N and k. The postcondition for this operation is su b= N+k.
w sub(k): Similar to add, this operation creates a new integer of the difference of both integer values. => the
postcondition for this operation is sum = N-k.
w set(k): Set N to k. The postcondition for this operation is N = k.
wend